package Panel;


import javax.swing.*;
import javax.swing.plaf.BorderUIResource;
import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class Test1 extends JApplet {

    public void init() {
        Container contentPane = getContentPane();
        JLabel label = new JLabel(
                "A long string that is high on verbiage and "
                + "low on content.");

        MultilineLabel multilineLabel = new MultilineLabel(
                "A long string that is high on verbiage and "
                + "low on content.");

        contentPane.setLayout(new BorderLayout(2, 10));

        contentPane.add(label, BorderLayout.NORTH);
        contentPane.add(multilineLabel, BorderLayout.CENTER);
    }
}

class MultilineLabel extends JTextArea {

    public MultilineLabel(String s) {
        super(s);
    }

    public void updateUI() {
        super.updateUI();

// turn on wrapping and disable editing and highlighting

        setLineWrap(true);
        setWrapStyleWord(true);
        setHighlighter(null);
        setEditable(false);

// Set the text area's border, colors and font to
// that of a label

        LookAndFeel.installBorder(this, "Label.border");

        LookAndFeel.installColorsAndFont(this,
                "Label.background",
                "Label.foreground",
                "Label.font");
    }
}
